name: Check Release

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  release:
    types: [published]

jobs:

  check_release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Base Setup
        uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

      - name: Check Release
        uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          version_spec: next

      - name: Upload Assets
        uses: actions/upload-artifact@v4
        with:
          name: jupyterlab-releaser-dist-${{ github.run_number }}
          path: |
            .jupyter_releaser_checkout/dist/*.*
